home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / eue10.zip / USERBANK.PRG < prev    next >
Text File  |  1992-12-29  |  6KB  |  195 lines

  1. *Extended User Editor (userbank) - version 1.0 12/30/92 (c) 1992 James E. Swarm
  2. *
  3. *This version of the program is fully working, and is to be considered
  4. *shareware.  If you use this software I ask that you register it with
  5. *a donation to my BBS.  Registered users will receive full tdbs source
  6. *(available for download) for both the USERLIST and USEREDIT program.  
  7. *A donation is $20.00 or higher... thats up to you, but the better 
  8. *responce I get, the more I will update the programs.
  9. *
  10. *Please send all donations to:
  11. *
  12. *James E. Swarm
  13. *
  14. *P.O. Box 361093
  15. *Strongsville, Ohio 44136
  16. *BBS (216)237-4980
  17. *
  18. SET EXCLUSIVE OFF
  19. SET ESCAPE OFF
  20. public f_add1,f_add2,f_city,f_state,f_zip,f_country,f_phone,f_location,f_realn,f_user,f_newubyte,f_newdbyte 
  21. public f_age,f_callmday,f_mday,f_ratiou,f_ratiod,f_timebank,f_modify
  22. public sname,answer,handle,counter,up_byte,down_byte
  23. clear
  24. if uansi()
  25.         set color to w+
  26. endif
  27. maxday = 120
  28. maxdep = 180
  29. opt = optdata()
  30. rec = at("t",opt)
  31. rec = substr(opt,rec+1)
  32. recend = at(chr(32),rec)
  33. timeu = substr(rec,1,recend -1)
  34. timeu = val(timeu)
  35. daymin = substr(rec,recend+2)
  36. daymin = val(daymin)
  37. timeu = timeu - 1
  38. use "useredit"
  39. set index to "username"
  40. user = uname()
  41. seek user
  42. if .NOT. found()
  43.         ? ""
  44.         ? "User Database Record Not Found, please contact sysop."
  45.         ? ""
  46.         wait
  47.         quit
  48. endif
  49.  
  50. do mainmenu
  51.  
  52. DO WHILE .T.
  53.         DO getanser WITH "WDR+",.T.,"+"
  54.         DO CASE
  55.         CASE answer = "D"
  56.                 ? ""
  57.                 ? "Enter the amount of time you wish to deposit."
  58.                 accept ": " to sname
  59.                 if empty(sname)
  60.                         loop
  61.                 endif
  62.                 dtime = val(sname)
  63.                 if dtime <= 0
  64.                         loop
  65.                 endif
  66.                 if dtime > timeu
  67.                         ? ""
  68.                         ? "You do not have that much time left to deposit."
  69.                         ? ""
  70.                         wait
  71.                         do mainmenu
  72.                         loop
  73.                 endif
  74.                 tatime = timeu - dtime
  75.                 maxdtime = f_timebank + dtime
  76.                 if maxdtime > maxdep
  77.                         ? ""
  78.                         ? "You have exceeded maximum timebank deposit."
  79.                         ? ""
  80.                         wait
  81.                         do mainmenu
  82.                         loop
  83.                 endif
  84.                 timeu = timeu - dtime
  85.                 if tatime = 0
  86.                         tatime = 1
  87.                 endif
  88.                 replace f_timebank with maxdtime
  89.                 tatime = tatime + daymin
  90.                 pokedummy=ulpoke(73,1,tatime)
  91.                 pokedummy=ulpoke(149,2,tatime)
  92.                 replace f_timeflag with .t.
  93.                 tdate = date()
  94.                 replace f_date with tdate
  95.                 do mainmenu
  96.                 loop
  97.  
  98.  
  99.         CASE answer = "W"
  100.                 callmday = ulpeek(73,1)
  101.                 mday = ulpeek(149,2)
  102.                 ? ""
  103.                 ? "Enter the amount of time you wish to withdraw."
  104.                 accept ": " to sname
  105.                 wtime = val(sname)
  106.                 if wtime < 0
  107.                         loop
  108.                 endif
  109.                 if wtime > f_timebank
  110.                         ? ""
  111.                         ? "You do not have that much time in your account."
  112.                         ? ""
  113.                         wait
  114.                         do mainmenu
  115.                         loop
  116.                 endif
  117.                 tatime = wtime + timeu
  118.                 if tatime > maxday
  119.                         ? ""
  120.                         ? "Your total exceeds maximum system withdraw time."
  121.                         ? ""
  122.                         wait
  123.                         do mainmenu
  124.                         loop
  125.                 endif
  126.                 if tatime > 255
  127.                         ? ""
  128.                         ? "Your total exceeds maximum system withdraw time."
  129.                         ? ""
  130.                         wait
  131.                         do mainmenu
  132.                         loop
  133.                 endif        
  134.                 timeu = timeu + wtime
  135.                 wtime = f_timebank - wtime
  136.                 replace f_timebank with wtime
  137.                 tatime = tatime + daymin
  138.                 pokedummy=ulpoke(73,1,tatime)
  139.                 pokedummy=ulpoke(149,2,tatime)
  140.                 replace f_timeflag with .t.
  141.                 tdate = date()
  142.                 replace f_date with tdate
  143.                 do mainmenu
  144.                 loop
  145.         
  146.         CASE answer = "R"
  147.                 quit
  148.         CASE answer = "+"
  149.                 do mainmenu
  150.                 loop
  151.  
  152.         ENDCASE
  153. ENDDO
  154. quit
  155.  
  156. PROCEDURE getanser
  157.  
  158. PARAMETER srchstrng, default, def_val
  159.  
  160. DO WHILE .T.
  161.         key = INKEY(0)
  162.         IF key = 13 .AND. default
  163.                 answer = def_val
  164.                 EXIT
  165.         ENDIF
  166.         answer = UPPER(CHR(key))
  167.         IF .NOT. answer $ srchstrng
  168.                 LOOP
  169.         ENDIF
  170.         ?? answer
  171.         EXIT
  172. ENDDO
  173. RETURN
  174.  
  175. procedure mainmenu
  176.  
  177. clear
  178. callmday = ulpeek(73,1)
  179. mday = ulpeek(149,2)
  180. ? "Time Bank Menu"
  181. ? ""
  182. ? "Current Balance          : " str(f_timebank,3)
  183. ? "Time Used Today          : " str(daymin,3)
  184. ? "Maximum Deposit Today    : " str(timeu,3)
  185. ? "Maximum Total Deposit    : " str(maxdep,3)
  186. ? "Maximum Withdraw Amount  : " str(maxday,3)
  187. ? ""
  188. ? "<D>eposit Time"
  189. ? "<W>ithdraw Time"
  190. ? "<R>eturn to UserMenu "
  191. ? ""
  192. ? "Command: "
  193. return
  194.  
  195.